{extend name="public/base"/} 
{block name="body"}


<style>.mui-table-view-cell p {    margin-bottom: 0;    font-size: 12px;}
.mui-table-view .mui-media-object {    
	line-height: 42px;   
	 width: 60px !important;        
	 max-width: 60px;    
	 height: 60px;}
	 .mui-card-header {    
	 	font-size: 12px;    border-radius: 2px 2px 0 0;        
	 	padding: 5px 10px;}
	 	


	 	</style>
	 	<header class="mui-bar mui-bar-nav"> 
	 		 <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>    
	 		 <h1 class="mui-title">水果查询</h1>   
	 		 </header>
	 		
	 		 
	 		 
	 		 
	 		 
	

	 		 <div class="mui-content" style="    margin-bottom: 100px;">	
	 		 				<div>			
	 		 					<form method="get">				
	 		 						<div>					
	输入菜名：<input type="text" class="form-control" name="scname" value="{$Think.get.remarkbak}" placeholder="请输入蔬菜名字">															  
	
	<div>		
		
	
	


	
	<!--
		 <div>
	 		 	
	 		 	<input type="file" accept="image/*" type="file" name="imageFile" onchange="upload()">

<div class="box">
    <canvas id="canvas" width="50" height="40"></canvas>
</div>
<script>
 function upload() {    
 	
        let file = document.querySelector('input[type=file]').files[0]  
        // 获取选择的文件，这里是图片类型    
        let reader = new FileReader()        
        reader.readAsDataURL(file) //读取文件并将文件以URL的形式保存在resulr属性中 base64格式        
        reader.onload = function(e) { // 文件读取完成时触发             
            let result = e.target.result // base64格式图片地址             
            var image = new Image();
            image.src = result // 设置image的地址为base64的地址             
            image.onload = function(){                 
                var canvas = document.querySelector("#canvas");                
                var ctx = canvas.getContext("2d");                 
                canvas.width = 200; // 设置canvas的画布宽度为图片宽度                 
                canvas.height = 200;                 
                ctx.drawImage(image, 0, 0, 200, 200) // 在canvas上绘制图片      
                let dataUrl = canvas.toDataURL('image/jpeg') // 0.92为压缩比，可根据需要设置，设置过小会影响图片质量                                                                  
            //   // dataUrl 为压缩后的图片资源，可将其上传到服务器   
            }   
            
        } 
}
</script>
	 		 </div>
	 		 
	 	-->	 
	 		 					  	
		<!--				    <input type="radio" name="fhren" value="1">四建                    
			<input type="radio" name="fhren" value="2">保健院-->	
						</div>					              					 
						<button class="btn btn-primary" type="submit">搜索</button>	
									</div>			<div> 	
													</form>
													
													
</br>
</br>	

<div>												
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/plugs/webuploader/webuploader.css">
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/plugs/webuploader/webuploader.custom.js"></script>											<!--dom结构部分-->
<div id="uploader-demo">
    <!--用来存放item-->
    <div id="fileList" class="uploader-list"></div>
    <div id="filePicker">选择图片</div>
</div>
</div>

								 
					<div class="modal fade "  id="myModal2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">        
						<div class="modal-dialog modal-sm">          
							<div class="modal-content">            
								<div class="modal-header">              
									<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span>
										<span class="sr-only">Close</span></button>              
										<h4 class="modal-title" id="myModalLabel">运费详细情况</h4>            
										</div>						
										<form class="form-horizontal2" action="{:url('index/goodshops/shucaiinsert')}" method="post">
											<div class="modal-body">	            	
												<!--<div>商品编号：<input type="text" name="yunfei"/></div>-->	            	
												<div>编号：<input type="text" name="bianhao"  style=" width: 100px;text-align: center;" /></div>	                
												<div>商品名称：<input type="text" name="shucainame"  style=" width: 100px;text-align: center;" /></div>
											<div>商品规格：<input type="text" name="guige"  style=" width: 100px;text-align: center;" /></div>					
											<div>商品1类价格：<input type="number" step="0.01" name="priceone"  style=" width: 100px;text-align: center;" />元</div>					
											<div>商品2类价格：<input type="number" step="0.01"  name="pricetwo"  style=" width: 100px;text-align: center;" />元</div>
				<input type="hidden" name="id" value="">	           
				 </div>	            <div class="modal-footer">	              
				 	<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>	  
				 	<button type="submit" class="btn btn-primary submit-btn ajax-post"  target-form="form-horizontal2">确定</button>	            
				 	</div>						</form>          </div>        </div>      </div>      
				 	<!--显示模态框-->			
				 	<script>						 
				 	$(function(){				 
				 	$('#myModal2').on('show.bs.modal', function (e) {	
				 					 															
				 					 															 })			 })			</script>													
</div>			
</form>		
</div>				
				 				<div>                                    
				 					 	</div>            
				 					 {if condition="$dlproxy gt 2"}      
					<table class="table">                       
				 				<thead>                         
				 				<tr>                                                     
				 				<th width="15%">水果名称</th>                            
				 				<th width="5%">规格名称</th>
				 				<th width="15%">修改日期</th>
				 				<th width="5%">库存</th>                             
				 				<th width="5%">成本</th>                            
				 				<th width="5%">商家售价</th>                            
				 				<th width="5%">零售价</th>
				 				<th width="5%">状态</th> 				 				   				 					 															 		      		 	 	                                                
				 			</tr>                        
				 			</thead>                       
				 			{volist name="dllist" id="vo"}                          
				 			<tr>																										
				 				<td><a href="javascript:;" 
				 					data-toggle="modal" 
				 					data-target="#myModal5"  
				 					data-stock="{$vo['stock']}" 
				 					data-id="{$vo['id']}" 
				 					data-price="{$vo['rule_price']}" 
				 					data-price2="{$vo['rule_price2']}" 
				 					data-price3="{$vo['rule_price3']}"
				 					data-goodname="{$vo['good_name']}"
				 					>{$vo.good_name}</a></td>														
				 				
				 				<td>{$vo.goodid}</td>
				 				<td>{$vo.update_time|strtotime|date='m-d',###} </td>
				 				<td>{$vo.stock}</td>														
				 				<td>{$vo.rule_price}</td>														
				 				<td>{$vo.rule_price2}</td>														
				 				<td>{$vo.rule_price3}</td>
				 				{if condition="$vo['status'] eq 1"}	
				 				<td><a href="{:url('editStatus',array('id'=>$vo.goodid, 'status'=>-1))}" class="confirm ajax-get">下架</a></td>
				 				{elseif condition="$vo['status'] eq -1"/}
				 				<td><a href="{:url('editStatus',array('id'=>$vo.goodid, 'status'=>1))}" class="confirm ajax-get">上架</a></td>
				 				 {/if}																										
				 				</tr>													                      
				 				{/volist}                      
				 				</table>{/if}</div>
				 				
				 				
				 				
	<div class="modal fade "  id="myModal5" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-sm">
          <div class="modal-content">
            <div class="modal-header">
              <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
              <h4 class="modal-title" id="myModalLabel">修改商品价格和库存</h4>
            </div>
						<form class="form-horizontal2" action="{:url('index/goodshops/editPrice')}" method="post">
	            <div class="modal-body">	            	
												<!--<div>商品编号：<input type="text" name="yunfei"/></div>-->	            	
												               
												<div>商品名称：<input type="text" disabled="disabled" name="good_name"  style=" width: 100px;text-align: center;" /></div>
											<div>成本：<input type="number" step="0.01" name="price"  style=" width: 100px;text-align: center;" />元</div>					
											<div>商品价格2：<input type="number" step="0.01" name="price2"  style=" width: 100px;text-align: center;" />元</div>					
											<div>商品价格3：<input type="number" step="0.01"  name="price3"  style=" width: 100px;text-align: center;" />元</div>
				                            <div>库存：<input type="number" step="0.01"  name="stock"  style=" width: 100px;text-align: center;" />元</div>
				<input type="hidden" name="id" value="">
	            </div>
	            <div class="modal-footer">
	              <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
	              <button type="submit" class="btn btn-primary submit-btn ajax-post"  target-form="form-horizontal2">确定</button>
	            </div>
						</form>
          </div>
        </div>
      </div>
			<script>
			 $(function(){
				 $('#myModal5').on('show.bs.modal', function (e) {
				 	
						var id = $(e.relatedTarget.outerHTML).attr('data-id');
						var price = $(e.relatedTarget.outerHTML).attr('data-price');
						var price2 = $(e.relatedTarget.outerHTML).attr('data-price2');
						var price3 = $(e.relatedTarget.outerHTML).attr('data-price3');
						var stock = $(e.relatedTarget.outerHTML).attr('data-stock');
						var goodname = $(e.relatedTarget.outerHTML).attr('data-goodname');
						$(e.target).find('[name="id"]').val(id);
						$(e.target).find('[name="stock"]').val(stock);
						$(e.target).find('[name="good_name"]').val(goodname);
						$(e.target).find('[name="price"]').val(price);
						$(e.target).find('[name="price2"]').val(price2);
						$(e.target).find('[name="price3"]').val(price3);
						
						
				 })
			 })
			</script>
				 				
{/block}


